load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_proto_grpc_python//:defs.bzl", "python_grpc_library")
load("@rules_python//python:defs.bzl", "py_test")

package(default_visibility = ["//visibility:private"])

# Test that python 3 dependencies protobuf and grpc are importable

proto_library(
    name = "proto_lib",
    srcs = ["demo.proto"],
)

python_grpc_library(
    name = "py_lib",
    output_mode = "NO_PREFIX_FLAT",
    prefix_path = "demo",
    protos = [":proto_lib"],
    python_version = "PY3",
)

py_test(
    name = "test",
    srcs = ["test.py"],
    legacy_create_init = False,
    python_version = "PY3",
    deps = [":py_lib"],
)
